Sorts sidebar nodes

<div class="definition">
    sort([options], [nodes])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>options</td>
        <td><b>object</b>, options for sort</td>
    </tr>
    <tr>
        <td>nodes</td>
        <td><b>array</b> (optional), array of nodes to start with</td>
    </tr>
    </table>
</div>
Returns <i>undefined</i>.

<h4>Description</h4>

This method will sort nodes of the sidebar preserving parent/child realtionship. You can suply sort options, but if you do not the default options are:
<textarea class="javascript">
options = {
    foldersFirst: true,
    caseSensitive: false,
    reverse: false
}
</textarea>
<div style="height: 10px"></div>

If you have sidebar defined in the following way:
<textarea class="javascript">
let sidebar = new w2sidebar({
    name : 'sidebar',
    img  : 'icon-page',
    nodes: [
        { id: 'id-1', text: 'Level 1' },
        { id: 'id-2', text: 'Level 2 (txt)' },
        { id: 'id-3', text: 'Level 3' }
    ]
});
</textarea>

You can:
<textarea class="javascript">
w2ui.sidebar.sort()
</textarea>
